package com.yxq.mdt.app.modules.splash.presenter;

import com.yxq.mdt.app.base.BasePresenter;
import com.yxq.mdt.app.modules.main.bean.NameAndPhoneBean;
import com.yxq.mdt.app.modules.splash.model.SplashModel;
import com.yxq.mdt.app.net.ApiModel;

/**
 * ================================================
 *
 * @function 闪屏页
 * Created by yd on 2019/03/26.
 * ================================================
 */
public class SplashPresenter extends BasePresenter<ISplashContract.View, SplashModel> implements ISplashContract.Presenter {

    public SplashPresenter(ISplashContract.View view, SplashModel model) {
        super(view, model);
    }


    @Override
    public void getUserInfo() {

        mBaseModel.getNameAndPhone(new ApiModel.CommonCallback<NameAndPhoneBean>() {
            @Override
            public void onSuccess(NameAndPhoneBean nameAndPhoneBean) {
                mRootView.onLoadNameAndPhoneSuccess(nameAndPhoneBean);
            }

            @Override
            public void onError(String errMsg) {
                mRootView.onLoadNameAndPhoneFailed(errMsg);
            }
        });

    }
}
